/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-07-17
 * Time: 11:25
 */
class Solution6 {
    public boolean increasingTriplet(int[] nums) {
        int n = nums.length;
        int a = nums[0],b = Integer.MAX_VALUE;

        for(int i = 1; i < n; i++) {
            if(nums[i] > b) {
                return true;
            }else if(nums[i] > a) {
                b = nums[i];
            }else {
                a = nums[i];
            }
        }
        return false;
    }
}
